﻿<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8" name="viewport" content="width=device-width" />
    <title>生产管理粗纱机</title>
    <link href="../../css/bootstrap.min.css" rel="stylesheet" />
    <script src="../../Content/scripts/jquery-1.11.1.min.js"></script>
    <link href="../../Content/styles/font-awesome.min.css" rel="stylesheet" />
    <link href="../../Content/scripts/plugins/jquery-ui/jquery-ui.min.css" rel="stylesheet" />
    <script src="../../Content/scripts/plugins/jquery-ui/jquery-ui.min.js"></script>
    <link href="../../Content/scripts/bootstrap/bootstrap.min.css" rel="stylesheet" />
    <script src="../../Content/scripts/bootstrap/bootstrap.min.js"></script>
    <link href="../../Content/scripts/plugins/jqgrid/jqgrid.css" rel="stylesheet" />
    <link href="../../Content/styles/learun-ui.css" rel="stylesheet" />
    <script src="../../Content/scripts/plugins/jqgrid/grid.locale-cn.js"></script>
    <script src="../../Content/scripts/plugins/jqgrid/jqgrid.min.js"></script>
    <script src="../../Content/scripts/plugins/tree/tree.js"></script>
    <script src="../../Content/scripts/plugins/validator/validator.js"></script>
    <script src="../../Content/scripts/utils/learun-ui.js"></script>
    <script src="../../Content/scripts/utils/learun-form.js"></script>
    <link href="../../Content/scripts/plugins/bootstrap-table/bootstrap-table.css" rel="stylesheet" />
    <script src="../../Content/scripts/plugins/bootstrap-table/bootstrap-table.js"></script>
    <script src="../../Content/scripts/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.js"></script>
    <script src="../../Content/scripts/plugins/layout/jquery.layout.js"></script>
    <script src="../../My97DatePicker/WdatePicker.js"></script>
    <script src="../../js/highcharts.js"></script>
    <script src="../../js/highcharts-3d.js"></script>
    <script src="../../js/getUrlParam.js"></script>
    <!--<script src="MFGjs.js"></script>-->
    <script src="../CustomerMFGJS.js"></script>
    <script src="../../MFG/MFGjs.js"></script>
    <style type="text/css">
        body {
            margin: 0px;
            margin-top: 10px;
        }

        .form .formTitle {
            width: 150px;
            font-size: 20px;
            padding-bottom: 35px;
        }

        .form .formValue {
            padding-bottom: 25px;
            width: 150px;
        }

        .valuestyle {
            font-size: 20px;
        }

        #title {
            font-size: 30px;
            text-shadow: 3px 3px 3px rgba(0, 0, 0, 0.5);
        }

        #time {
            font-size: 20px;
            float: right;
            line-height: 50px;
            right: 40px;
            position: fixed;
            color: #65b540;
        }

        @media screen and (min-width:1281px) and (max-width:1440px) {
            .valuestyle {
                font-size: 15px;
            }

            .form .formTitle {
                font-size: 15px;
                padding-bottom: 0px;
            }

            .form .formValue {
                padding-bottom: 0px;
            }
        }

        @media screen and (max-width:1024px) {
            .valuestyle {
                font-size: 15px;
            }

            .form .formTitle {
                font-size: 15px;
                padding-bottom: 0px;
            }

            .form .formValue {
                padding-bottom: 0px;
            }
        }



        @media screen and (min-width:1025px) and (max-width:1280px) {
            .valuestyle {
                font-size: 15px;
            }

            .form .formTitle {
                font-size: 15px;
                padding-bottom: 0px;
            }

            .form .formValue {
                padding-bottom: 0px;
            }
        }

        #info {
            float: right;
            color: #ff0000;
            font-size: 9px;
        }

        a {
            color: skyblue;
            text-decoration: none;
            cursor: pointer;
        }

        span {
            border-radius: 100px;
        }

        .highcharts-subtitle {
            left: 260px;
        }

            .highcharts-subtitle a {
                font-size: 20px;
            }

        #tipStart, #tipEnd {
            opacity: 0;
        }

        /*#container {
                width: 1500px;
                margin: 0 auto;
            }*/
        #kaitingcehtongjitu, #guzhangtongjitu, #weisha_guzhangtongjitu {
            opacity: 0;
            margin-top: 10px;
            /*width: 1500px;*/
            margin: 0 auto;
        }

        #kaitingcehtongjitu, #weisha_kaitingcehtongjitu {
            float: left;
            width: 100%;
        }

        #kaitingcehtongjipie, #weisha_kaitingcehtongjipie {
            opacity: 0;
            float: left;
        }

        #westpanel, #centerpanel, #shengchanwanchengpie, #weishawestpanel, #weishacenterpanel {
            opacity: 0;
        }
    </style>

</head>

<body>
    <div style="text-align: center; height: 50px;">
        <span id="title">单台监视</span>
        <span id="time"></span>
    </div>
    <!--粗纱单台数据-->
    <div  id="dantaijianshi">
        <div class="panel-Title">
            粗纱单台监视
        </div>
        <div class="titlePanel">
            <div class="title-search">
                <table>
                    <tr>
                        <td style="padding-left: 5px;">
                            <span>选择粗纱台号：</span>
                        </td>
                        <td style="padding-left: 5px;">
                            <select class="form-control" id="equnolist" style="width: 100px;"></select>
                        </td>
                        <td style="padding-left: 5px;">
                            <a id="btn_Search" class="btn btn-primary"><i class="fa fa-search"></i>&nbsp;查询</a>
                        </td>
                    </tr>
                </table>
            </div>
        </div>

        <table id="dantaijianshitable"></table>

        <!--<div class="ui-layout" id="zhenxiantulayout" style="width:100%;">
            <div class="ui-layout-west" id="zhenxiantuwestpanel">
                <div class="west-Panel">
                    <div class="panel-Title">实时统计信息图</div>
                    <div class="title-search" style="margin-top: 20px;">
                        <table>
                            <tr>
                                <td style="padding-left: 5px;">
                                    <span>选择粗纱台号：</span>
                                </td>
                                <td style="padding-left: 5px;">
                                    <select class="form-control" id="equnolist1" style="width: 100px;"></select>
                                </td>
                                <td style="padding-left: 5px;">
                                    <span>参数类型：</span>
                                </td>
                                <td style="padding-left: 5px;">
                                    <select class="form-control" id="parmlist" style="width: 200px;">
                                        <option value="1" selected>锭翼电机速度</option>
                                        <option value="2">筒管电机速度</option>
                                        <option value="3">罗拉电机速度</option>
                                        <option value="4">升降电机速度</option>
                                        <option value="5">龙筋位置</option>
                                    </select>
                                </td>
                                <td style="padding-left: 5px;">
                                    <a id="btn_currentLuosha" class="btn btn-primary"><i class="fa fa-search"></i>&nbsp;当前落纱</a>
                                </td>
                                <td style="padding-left: 20px;">
                                    <span id="tipStart">当前落纱开始时间：</span>
                                </td>
                                <td style="padding-left: 5px;">
                                    <label id="tipStartValue"></label>
                                </td>
                                <td style="padding-left: 5px;">
                                    <span id="tipEnd">当前落纱层数：</span>
                                </td>
                                <td style="padding-left: 5px;">
                                    <label id="tipEndValue"></label>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <div id="zhexiantu" style=" margin-top: 20px;"></div>
                </div>
            </div>

            <div class="ui-layout-center" id="zhexiantucenterpanel">
                <div class="center-Panel">
                    <div class="panel-Title">停车分析饼图</div>
                    <div class="title-search" style="margin-top: 20px;">

                    </div>
                    <div id="tingcehfenxibingtu" style="margin-top:73px;"></div>
                </div>
            </div>
        </div>-->
    </div>
    <script>
        var ID = getCookie("CustomerID");
        $(function () {
            getTime()
            //$("#zhenxiantulayout").height($(window).height() - 350);
            //////layout布局
            //$('#zhenxiantulayout').layout({
            //    applyDemoStyles: true,
            //    west: {
            //        size: $(window).width() * 0.6
            //    },
            //    onresize: function () {
            //        $(window).resize()
            //    }
            //});
            $.CustomerMFGjs.getEquNolistByCustomerID(ID, 1);

            //查询事件
            $("#btn_Search").click(function () {
                Loading(true);
                $('#dantaijianshitable').jqGrid("clearGridData");
                $('#dantaijianshitable').jqGrid('setGridParam', {
                    postData: {
                        Action: "initdangtaijianshidata",
                        EquNo: $('#equnolist').find('option:selected').val(),
                        TaiHao: $('#equnolist').find('option:selected').text(),
                        Time: $("#time").text()
                    },
                }).trigger('reloadGrid');
            });
            //当前落纱按钮点击
            //$("#btn_currentLuosha").click(function () {
            //    Loading(true);

            //    $.CustomerMFGjs.initcurrentluoshaStartEnd(ID, $("#equnolist1").find("option:selected").text(), $("#time").text());

            //});
           
        });
       
        /*

* ajax 函数，处理 ajax 请求

* @param function callback 回调函数

* @因为要和服务器交互，所以必须在服务器环境运行，不能在硬盘上直接打开

*/

        function ajax(callback) {

            if (typeof callback != 'function') return;

            var ajaxObject;

            try {

                ajaxObject = new XMLHttpRequest();

            } catch (e) {

                try {

                    ajaxObject = new ActiveXObject('Microsoft.XMLHTTP');

                } catch (e) {

                }

            }

            if (!ajaxObject) return;

            if (ajaxObject.overrideMimeType) {

                ajaxObject.overrideMimeType('text/html');

            }

            //location.href可以换成其他url，但必须是同一个站点的链接，并且文件存在

            ajaxObject.open('get', location.href);

            ajaxObject.send(null);

            ajaxObject.onreadystatechange = function () {

                if (ajaxObject.readyState == 4) {

                    if (ajaxObject.status == 200) {

                        callback(ajaxObject);

                    }

                }

            };

        }

        /*

         * 获取时间并动态刷新

        */

        function getTime() {

            ajax(

                function (ao) {

                    //只需要AJAX一次，将服务器时间获取后以毫米为单位保存到一个变量中

                    _timestamp = Date.parse(ao.getResponseHeader('Date'));

                    _timestamp = _timestamp.toString().match(/^\d$/) ? _timestamp : new Date().getTime();

                    //设置定时器每过一秒动态刷新一次时间

                    setInterval(

                        function () {

                            //这里可以自定义时间显示格式

                            //document.getElementById('time').innerHTML = new Date(_timestamp)
                            var oDiv = document.getElementById("time");
                            var date = new Date(_timestamp);
                            var year = date.getFullYear();//当前年份
                            var month = date.getMonth();//当前月份
                            var data = date.getDate();//天
                            var hours = date.getHours();//小时
                            var minute = date.getMinutes();//分
                            var second = date.getSeconds();//秒
                            var time = year + "-" + fnW((month + 1)) + "-" + fnW(data) + " " + fnW(hours) + ":" + fnW(minute) + ":" + fnW(second);
                            oDiv.innerHTML = time;
                            _timestamp += 1000;

                        },

                        1000

                    );

                }

            );

        }

        window.onload = getTime;

        //读取cookie
        function getCookie(name) {
            var arr = document.cookie.match(new RegExp("(^| )" + name + "=([^;]*)(;|$)"));
            if (arr != null) return decodeURI(arr[2]); return null;
        };

        ////补位 当某个字段不是两位数时补0
        function fnW(str) {
            var num;
            str > 9 ? num = str : num = "0" + str;
            return num;
        }
    </script>

</body>
</html>